<template>
  <div class="panel ad-panel">
    <div class="panel-header">
      <i class="fas fa-bullhorn" />
      <span>广告推荐</span>
    </div>
    <div class="ad-list">
      <a
        v-for="(ad, idx) in ads"
        :key="idx"
        class="ad-item"
        :href="ad.link"
        target="_blank"
        rel="noopener"
      >
        <img :src="ad.image" :alt="ad.title" />
        <div class="ad-info">
          <h4 class="ad-title">{{ ad.title }}</h4>
          <p class="ad-desc">{{ ad.desc }}</p>
        </div>
      </a>
    </div>
  </div>
</template>

<script setup lang="ts">
interface AdItem {
  title: string;
  desc: string;
  image: string;
  link: string;
}
const ads: AdItem[] = [
  {
    title: '赞助位 A',
    desc: '投放你的品牌/产品',
    image: '/static/img/normal.webp',
    link: '#'
  },
  {
    title: '赞助位 B',
    desc: '提升曝光与转化',
    image: '/static/img/blindfold.webp',
    link: '#'
  }
];
</script>

<style scoped lang="scss">
.panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 16px;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
  i {
    color: #3b82f6;
  }
}
.ad-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ad-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: #334155;
  transition: all 0.2s ease;
  &:hover {
    background: #f8fafc;
  }
}
.ad-item img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}
.ad-title {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  color: #0f172a;
}
.ad-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}
</style>
